<template>
  <div class="detail-layout">
    <crumbList :navList="navList"></crumbList>
    <list :itemData="projectList" :route="route"></list>
  </div>
</template>
<script>
  import crumbList from '../../common/crumbList.vue'
  import list from '../../common/list.vue'
  import { mapState, mapActions } from 'vuex'

  export default {
    data () {
      return {
        navList: [
          {name: '项目详情', path: ''},
          {name: '机具安装', path: 'install'},
          {name: '项目选择', path: ''}
        ],
        route: 'installList'
      }
    },
    computed: {
      ...mapState(['projectList'])
    },
    components: {crumbList, list},
    created () {
      this.getProjectData()
    },
    methods: {
      ...mapActions(['getProjectList']),
      // 获取项目列表
      getProjectData () {
        let url = this.api2.install.projectList
        let obj = {url: url, msg: this.$message}
        this.getProjectList(obj)
      }
    }
  }
</script>

